package cn.itcast.travel.web.servlet.blogger;

import cn.itcast.travel.domain.blog;
import cn.itcast.travel.service.BlogService;
import cn.itcast.travel.service.BloggerService;
import cn.itcast.travel.service.impl.BlogServiceImpl;
import cn.itcast.travel.service.impl.BloggerServiceImpl;
import com.fasterxml.jackson.databind.ObjectMapper;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.annotation.*;
import java.io.IOException;
import java.util.List;

@WebServlet(name = "Personalblog", value = "/Personalblog")
public class Personalblog extends HttpServlet {
    BloggerService service=new BloggerServiceImpl();
    //用户获取发表过的博客
    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        String id=request.getParameter("id");
        ObjectMapper ob=new ObjectMapper();
        ob.writeValue(response.getWriter(),service.Personalblog(id));
    }

    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

    }
}
